home *** CD-ROM | disk | FTP | other *** search
- #include <alloc.h>
- #include <conio.h>
- #include <string.h>
- #include <stdlib.h>
- #include "filefunc.h"
- #include "graph.h"
- #include "drvrfunc.h"
-
- int mixer;
- char *statStr[] = {"missing", "loaded"};
- char *memErr = "Unable to allocate memory for background save.";
-
- //--------------------------------------------------------------------------
- // screen data definitions
- //--------------------------------------------------------------------------
- char slider[4] = {'▒',0x10,'█',0x1f};
- char errBoxLine[] = {'═',0x4f};
- char errBoxSpace[] = {' ',0x4f};
- char errBoxLeft[] = {'╔',0x4f,'═',0x4f,'═',0x4f,'║',0x4f,' ',0x4f,' ',0x4f,
- '║',0x4f,' ',0x4f,' ',0x4f,'║',0x4f,' ',0x4f,' ',0x4f,
- '╚',0x4f,'═',0x4f,'═',0x4f};
-
- char errBoxRight[] = {'═',0x4f,'═',0x4f,'╗',0x4f,' ',0x4f,' ',0x4f,'║',0x4f,
- ' ',0x4f,' ',0x4f,'║',0x4f,' ',0x4f,' ',0x4f,'║',0x4f,
- '═',0x4f,'═',0x4f,'╝',0x4f};
-
- char infoBoxTop[] = {'╔',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'╗',0x1f,'║',0x1f,' ',0x1f,'S',0x1f,
- 'B',0x1f,'S',0x1f,'I',0x1f,'M',0x1f,',',0x1f,' ',0x1f,
- 'V',0x1f,'e',0x1f,'r',0x1f,'s',0x1f,'i',0x1f,'o',0x1f,
- 'n',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ',',0x1f,' ',0x1f,' ',0x1f,'U',0x1f,'s',0x1f,'i',0x1f,
- 'n',0x1f,'g',0x1f,' ',0x1f,'i',0x1f,'n',0x1f,'t',0x1f,
- 'e',0x1f,'r',0x1f,'r',0x1f,'u',0x1f,'p',0x1f,'t',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,'h',0x1f,' ',0x1f,'║',0x1f};
-
- char infoBox[] = {'╟',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,
- '─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,
- '─',0x1f,'┬',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,
- '─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,
- '─',0x1f,'─',0x1f,'┬',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,
- '─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,
- '─',0x1f,'┬',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,
- '─',0x1f,'─',0x1f,'╨',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,
- '┬',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,
- '─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,
- '┬',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,
- '─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'╖',0x1f,
- '║',0x1f,' ',0x1f,'N',0x1f,'a',0x1f,'m',0x1f,'e',0x1f,
- '.',0x1f,'.',0x1f,'.',0x1f,'.',0x1f,'.',0x1f,'.',0x1f,
- '.',0x1f,'│',0x1f,'C',0x1f,'T',0x1f,'-',0x1f,'V',0x1f,
- 'O',0x1f,'I',0x1f,'C',0x1f,'E',0x1f,'.',0x1f,'D',0x1f,
- 'R',0x1f,'V',0x1f,'│',0x1f,'C',0x1f,'T',0x1f,'V',0x1f,
- 'D',0x1f,'S',0x1f,'K',0x1f,'.',0x1f,'D',0x1f,'R',0x1f,
- 'V',0x1f,'│',0x1f,'A',0x1f,'U',0x1f,'X',0x1f,'D',0x1f,
- 'R',0x1f,'V',0x1f,'.',0x1f,'D',0x1f,'R',0x1f,'V',0x1f,
- '│',0x1f,'S',0x1f,'B',0x1f,'F',0x1f,'M',0x1f,'D',0x1f,
- 'R',0x1f,'V',0x1f,'.',0x1f,'C',0x1f,'O',0x1f,'M',0x1f,
- '│',0x1f,'S',0x1f,'B',0x1f,'M',0x1f,'I',0x1f,'D',0x1f,
- 'I',0x1f,'.',0x1f,'E',0x1f,'X',0x1f,'E',0x1f,'║',0x1f,
- '║',0x1f,' ',0x1f,'S',0x1f,'t',0x1f,'a',0x1f,'t',0x1f,
- 'u',0x1f,'s',0x1f,'.',0x1f,'.',0x1f,'.',0x1f,'.',0x1f,
- '.',0x1f,'│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,'│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,'│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- '│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- '│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,'║',0x1f,
- '║',0x1f,' ',0x1f,'E',0x1f,'n',0x1f,'t',0x1f,'r',0x1f,
- 'y',0x1f,' ',0x1f,'p',0x1f,'o',0x1f,'i',0x1f,'n',0x1f,
- 't',0x1f,'│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,'│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,'│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- '│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- '│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,'║',0x1f,
- '║',0x1f,' ',0x1f,'B',0x1f,'u',0x1f,'f',0x1f,'f',0x1f,
- 'e',0x1f,'r',0x1f,' ',0x1f,'l',0x1f,'o',0x1f,'c',0x1f,
- '.',0x1f,'│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,'│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,'│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- '│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- '│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,'║',0x1f,
- '║',0x1f,' ',0x1f,'B',0x1f,'u',0x1f,'f',0x1f,'f',0x1f,
- 'e',0x1f,'r',0x1f,' ',0x1f,'S',0x1f,'i',0x1f,'z',0x1f,
- 'e',0x1f,'│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,'│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,'│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- '│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- '│',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,
- ' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,'║',0x1f,
- '╚',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'╧',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'╧',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '[',0x1f,'H',0x1f,'i',0x1f,'t',0x1f,' ',0x1f,'A',0x1f,
- 'n',0x1f,'y',0x1f,' ',0x1f,'K',0x1f,'e',0x1f,'y',0x1f,
- ']',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '╧',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '╧',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'╝',0x1f};
-
- char title[] = {'╔',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'╗',0x1f,'║',0x1f,' ',0x1e,' ',0x1e,' ',0x1e,
- 'S',0x1e,'o',0x1e,'u',0x1e,'n',0x1e,'d',0x1e,' ',0x1e,'B',0x1e,
- 'l',0x1e,'a',0x1e,'s',0x1e,'t',0x1e,'e',0x1e,'r',0x1e,' ',0x1e,
- 'S',0x1e,'i',0x1e,'m',0x1e,'p',0x1e,'l',0x1e,'i',0x1e,'f',0x1e,
- 'i',0x1e,'e',0x1e,'d',0x1e,' ',0x1e,'I',0x1e,'n',0x1e,'t',0x1e,
- 'e',0x1e,'r',0x1e,'f',0x1e,'a',0x1e,'c',0x1e,'e',0x1e,' ',0x1e,
- 'M',0x1e,'o',0x1e,'d',0x1e,'u',0x1e,'l',0x1e,'e',0x1e,' ',0x1e,
- '(',0x1e,'S',0x1e,'B',0x1e,'S',0x1e,'I',0x1e,'M',0x1e,')',0x1e,
- ' ',0x1e,'D',0x1e,'e',0x1e,'m',0x1e,'o',0x1e,'n',0x1e,'s',0x1e,
- 't',0x1e,'r',0x1e,'a',0x1e,'t',0x1e,'i',0x1e,'o',0x1e,'n',0x1e,
- ' ',0x1e,'P',0x1e,'r',0x1e,'o',0x1e,'g',0x1e,'r',0x1e,'a',0x1e,
- 'm',0x1e,' ',0x1e,' ',0x1e,' ',0x1e,' ',0x1e,'║',0x1f,'╚',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,
- '═',0x1f,'╝',0x1f};
-
- char backgnd[] = {'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,
- '▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,
- '▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,
- '▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,
- '▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,
- '▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,
- '▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,
- '▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,
- '▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,
- '▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,
- '▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,'▒',0x17,
- '▒',0x17,'▒',0x17,'▒',0x17};
-
- char menu[] = {' ',0x70,'E',0x70,'S',0x70,'C',0x70,' ',0x70,'-',0x70,' ',0x70,
- 'e',0x70,'x',0x70,'i',0x70,'t',0x70,'│',0x70,'T',0x70,'A',0x70,
- 'B',0x70,' ',0x70,'-',0x70,' ',0x70,'c',0x70,'h',0x70,'g',0x70,
- '.',0x70,' ',0x70,'w',0x70,'i',0x70,'n',0x70,'d',0x70,'o',0x70,
- 'w',0x70,'│',0x70,'',0x70,'─',0x70,'┘',0x70,' ',0x70,'-',0x70,
- ' ',0x70,'S',0x70,'t',0x70,'a',0x70,'r',0x70,'t',0x70,'/',0x70,
- 'S',0x70,'t',0x70,'o',0x70,'p',0x70,'│',0x70,'S',0x70,'p',0x70,
- 'a',0x70,'c',0x70,'e',0x70,' ',0x70,'-',0x70,' ',0x70,'P',0x70,
- 'a',0x70,'u',0x70,'s',0x70,'e',0x70,'/',0x70,'C',0x70,'o',0x70,
- 'n',0x70,'t',0x70,'│',0x70,'F',0x70,'1',0x70,' ',0x70,'-',0x70,
- ' ',0x70,'D',0x70,'v',0x70,'r',0x70,' ',0x70,'I',0x70,'n',0x70,
- 'f',0x70,'o',0x70,' ',0x70};
-
- char hwintop[] = {'╔',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f
- ,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f
- ,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f
- ,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f
- ,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'╗',0x1f};
-
- char hwinmid[] = {'║',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f
- ,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f
- ,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f
- ,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f
- ,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,' ',0x1f,'║',0x1f};
-
- char hwinlin[] = {'╟',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f
- ,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f
- ,' ',0x1f,'V',0x1f,'o',0x1f,'l',0x1f,'u',0x1f,'m',0x1f,'e',0x1f
- ,' ',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f
- ,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'─',0x1f,'╢',0x1f};
-
- char hwinvol[] = {'║',0x1f,' ',0x1f,'═',0x12,'═',0x12,'═',0x12,'═',0x12,'═',0x12
- ,'═',0x12,'═',0x12,'═',0x12,'═',0x12,'═',0x12,'═',0x1a,'═',0x1a
- ,'═',0x1a,'═',0x1a,'═',0x1a,'═',0x1a,'═',0x1a,'═',0x1a,'═',0x1e
- ,'═',0x1e,'═',0x1e,'═',0x1e,'═',0x1e,'═',0x1e,'═',0x1e,'═',0x1c
- ,'═',0x1c,'═',0x1c,'═',0x14,'═',0x14,' ',0x1f,'║',0x1f};
-
- char hwinbot[] = {'╚',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f
- ,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f
- ,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f
- ,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f
- ,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'═',0x1f,'╝',0x1f};
-
- char wintop[] = {'╔',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10
- ,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10
- ,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10
- ,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10
- ,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'╗',0x10};
-
- char winmid[] = {'║',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10
- ,' ',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10
- ,' ',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10
- ,' ',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10
- ,' ',0x10,' ',0x10,' ',0x10,' ',0x10,' ',0x10,'║',0x10};
-
- char winlin[] = {'╟',0x10,'─',0x10,'─',0x10,'─',0x10,'─',0x10,'─',0x10,'─',0x10
- ,'─',0x10,'─',0x10,'─',0x10,'─',0x10,'─',0x10,'─',0x10,'─',0x10
- ,' ',0x10,'V',0x10,'o',0x10,'l',0x10,'u',0x10,'m',0x10,'e',0x10
- ,' ',0x10,'─',0x10,'─',0x10,'─',0x10,'─',0x10,'─',0x10,'─',0x10
- ,'─',0x10,'─',0x10,'─',0x10,'─',0x10,'─',0x10,'╢',0x10};
-
- char winvol[] = {'║',0x10,' ',0x10,'═',0x12,'═',0x12,'═',0x12,'═',0x12,'═',0x12
- ,'═',0x12,'═',0x12,'═',0x12,'═',0x12,'═',0x12,'═',0x1a,'═',0x1a
- ,'═',0x1a,'═',0x1a,'═',0x1a,'═',0x1a,'═',0x1a,'═',0x1a,'═',0x1e
- ,'═',0x1e,'═',0x1e,'═',0x1e,'═',0x1e,'═',0x1e,'═',0x1e,'═',0x1c
- ,'═',0x1c,'═',0x1c,'═',0x14,'═',0x14,' ',0x10,'║',0x10};
-
- char winbot[] = {'╚',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10
- ,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10
- ,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10
- ,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10
- ,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'═',0x10,'╝',0x10};
-
- char shadow[] = {'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01
- ,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01
- ,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01
- ,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01
- ,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01,'░',0x01
- ,'░',0x01,'░',0x01};
-
- //--------------------------------------------------------------------------
- // function definitions
- //--------------------------------------------------------------------------
-
- /**************************************************************************
- * FUNCTION: DRAWBACKGROUND - Draws the background pattern in the requested
- * rectangle.
- *
- * Inputs: x1 - Left side.
- * y1 - Top.
- * x2 - Right side.
- * y2 - Bottom.
- *
- * Output: none
- **************************************************************************/
- void DrawBackground(int x1, int y1, int x2, int y2)
- {
- int i;
-
- if((x2 - x1) <= (y2 - y1))
- for(i = y1; i <= y2; i++)
- puttext(x1, i, x2, i, backgnd);
- else
- for(i = x1; i <= x2; i++)
- puttext(i, y1, i, y2, backgnd);
- }
-
- /*************************************************************************
- * FUNCTION: DRAWWINDOW - draws the windows which display the digital
- * voice and music files.
- *
- * Inputs: *win - pointer to window structure
- * state - state to draw window in (NORMAL or HIGHLIGHT).
- *
- * Output: none
- *************************************************************************/
- void DrawWindow(WINDOW *win, int state)
- {
- int i;
- COORD loc;
-
- loc.x = (state == HIGHLIGHT)? win->loc.x - 2 : win->loc.x;
- loc.y = (state == HIGHLIGHT)? win->loc.y - 1 : win->loc.y;
-
- if(state == HIGHLIGHT)
- {
- puttext(loc.x + win->size.x + 1, loc.y + 1,
- loc.x + win->size.x + 2, loc.y + win->size.y,
- shadow);
- puttext(loc.x + 2, loc.y + win->size.y + 1,
- loc.x + win->size.x + 2, loc.y + win->size.y + 1,
- shadow);
- }
- else
- {
- DrawBackground(loc.x - 2, loc.y - 1,
- loc.x - 1, loc.y + win->size.y - 1);
- DrawBackground(loc.x, loc.y - 1,
- loc.x + win->size.x - 2, loc.y - 1);
- }
-
- puttext(loc.x, loc.y, loc.x + win->size.x, loc.y,
- (state == HIGHLIGHT)? hwintop : wintop);
- for(i = 1; i < 14; i++)
- puttext(loc.x, loc.y + i,
- loc.x + win->size.x, loc.y + i,
- (state == HIGHLIGHT)? hwinmid : winmid);
- if(mixer == ON)
- {
- puttext(loc.x, loc.y + win->size.y - 2,
- loc.x + win->size.x, loc.y + win->size.y - 2,
- (state == HIGHLIGHT)? hwinlin : winlin);
- puttext(loc.x, loc.y + win->size.y - 1,
- loc.x + win->size.x, loc.y + win->size.y - 1,
- (state == HIGHLIGHT)? hwinvol : winvol);
- }
- else
- {
- puttext(loc.x, loc.y + win->size.y - 2,
- loc.x + win->size.x, loc.y + win->size.y - 2,
- (state == HIGHLIGHT)? hwinmid : winmid);
- puttext(loc.x, loc.y + win->size.y - 1,
- loc.x + win->size.x, loc.y + win->size.y - 1,
- (state == HIGHLIGHT)? hwinmid : winmid);
- }
-
- puttext(loc.x, loc.y + win->size.y,
- loc.x + win->size.x, loc.y + win->size.y,
- (state == HIGHLIGHT)? hwinbot : winbot);
-
- textcolor((state == HIGHLIGHT)? WHITE : BLACK);
- textbackground(BLUE);
-
- gotoxy(loc.x + win->size.x, loc.y + 1);
- putch('');
- gotoxy(loc.x + win->size.x, loc.y + win->size.y - ((mixer == ON)? 3 : 1));
- putch('');
-
- gotoxy(loc.x + 1 + ((win->size.x - strlen(win->title)) >> 1), loc.y);
- cputs(win->title);
-
- if(mixer == ON)
- {
- gotoxy(loc.x + 3, loc.y + win->size.y);
- cputs(" « ");
- gotoxy(loc.x + win->size.x - 5, loc.y + win->size.y);
- cputs(" » ");
-
- DrawSlider(win, win->mixLvl, state);
- }
- DrawFileList(win, state);
- }
-
- /*************************************************************************
- * FUNCTION: INITSCREEN - intializes the screen by turning off the cursor,
- * drawing the title, drawing the desktop, and
- * drawing the keyboard options across the bottom.
- *
- * Inputs: none
- *
- * Output: none
- *************************************************************************/
- void InitScreen(void)
- {
- _setcursortype(_NOCURSOR);
- puttext(1, 1, 80, 3, title);
- DrawBackground(1, 4, 80, 24);
- puttext(1, 25, 80, 25, menu);
- }
-
- /*************************************************************************
- * FUNCTION: DEMOEXIT - exits demo by turning cursor back on, setting
- * colors back to normal, clearing the screen, and
- * exiting the program.
- *
- * Inputs: exitState - EXIT_FAILURE or EXIT_SUCCESS
- *
- * Output: none
- *************************************************************************/
- void DemoExit(int exitState)
- {
- _setcursortype(_NORMALCURSOR);
- textcolor(LIGHTGRAY);
- textbackground(BLACK);
- clrscr();
- exit(exitState);
- }
-
- /*************************************************************************
- * FUNCTION: DRAWSLIDER - draws the volume slider one line up from the
- * bottom of the window.
- *
- * Inputs: *win - pointer to window structure
- * level - scaled volume level (0 - 29)
- * state - state to draw window in (NORMAL or HIGHLIGHT).
- *
- * Output: none
- *************************************************************************/
- void DrawSlider(WINDOW *win, int level, int state)
- {
- COORD loc;
-
- loc.x = (state == HIGHLIGHT)? win->loc.x - 2 : win->loc.x;
- loc.y = (state == HIGHLIGHT)? win->loc.y - 1 : win->loc.y;
-
- if(win->lastChr != 0)
- puttext(loc.x + (win->mixLvl * 29) / 247 + 2, loc.y + win->size.y - 1,
- loc.x + (win->mixLvl * 29) / 247 + 2, loc.y + win->size.y - 1,
- (void *)&(win->lastChr));
-
- gettext(loc.x + (level * 29) / 247 + 2, loc.y + win->size.y - 1,
- loc.x + (level * 29) / 247 + 2, loc.y + win->size.y - 1,
- (void *)&(win->lastChr));
-
- win->mixLvl = level;
-
- puttext(loc.x + (level * 29) / 247 + 2, loc.y + win->size.y - 1,
- loc.x + (level * 29) / 247 + 2, loc.y + win->size.y - 1,
- &(slider[state * 2]));
- }
-
- /*************************************************************************
- * FUNCTION: DRAWFILELIST - draws the list of file names in the desired
- * window.
- *
- * Inputs: *win - pointer to window structure
- * state - state to draw window in (NORMAL or HIGHLIGHT).
- *
- * Output: none
- *************************************************************************/
- void DrawFileList(WINDOW *win, int state)
- {
- FILELEMENT *temp;
- int x;
- int y;
-
- temp = win->fileList.start;
- y = win->loc.y + ((state == HIGHLIGHT)? 0 : 1);
- x = win->loc.x + ((state == HIGHLIGHT)? -1 : 1);
-
- if(win->status & VIEWABLE)
- while(temp != win->fileList.stop->next)
- {
- if((temp == win->fileList.current) && (state == HIGHLIGHT))
- textattr((CYAN << 4) + YELLOW);
- else
- textattr((BLUE << 4) + ((state == HIGHLIGHT)? LIGHTGRAY : BLACK));
- gotoxy(x, y++);
- switch (temp->status)
- {
- case PLAYING:
- cprintf(" %s <─── PLAYING ──── ", temp->filename);
- break;
- case PAUSED:
- cprintf(" %s <─── PAUSED ───── ", temp->filename);
- break;
- case STOPPED:
- cprintf(" %s ", temp->filename);
- break;
- }
- temp = temp->next;
- }
- else
- {
- gotoxy(win->loc.x + win->size.x / 2 - 6, win->loc.y + win->size.y / 2 - 1);
- cputs("No files found");
- }
- }
-
- /*************************************************************************
- * FUNCTION: DRAWERROR - saves the screen under the error box, draws the
- * box displaying the desired error, waits for a
- * keystroke, and then replaces the saved info.
- *
- * Inputs: *errorStr - string to display in the error box.
- *
- * Output: status - error (not enough memory for save).
- *************************************************************************/
- int DrawError(char *errorStr)
- {
- int i;
- int strLength;
- int startX;
- char *saved;
-
- strLength = strlen(errorStr);
- startX = (80 - strLength) / 2 - 2;
-
- saved = (char *)malloc((strLength + 6) * 5);
- if(saved == NULL)
- {
- cprintf("\nFatal Error! - unable to allocate memory for error window background save.\n\r");
- return(ERROR);
- }
- // save background
- gettext(startX, 10, startX + strLength + 6, 15, saved);
-
- textcolor(WHITE);
- textbackground(RED);
-
- puttext(startX, 10, startX + 2, 14, errBoxLeft);
- puttext(startX + strLength + 3, 10, startX + strLength + 5, 14, errBoxRight);
- for(i = startX + 3; i < (startX + strLength + 3); i++)
- {
- puttext(i, 10, i, 10, errBoxLine);
- puttext(i, 11, i, 11, errBoxSpace);
- puttext(i, 13, i, 13, errBoxSpace);
- puttext(i, 14, i, 14, errBoxLine);
- }
-
- puttext(startX + 1, 15, startX + strLength / 2 + 4, 15, shadow);
- puttext(startX + strLength / 2 + 5, 15, startX + strLength + 6, 15, shadow);
- puttext(startX + strLength + 6, 11, startX + strLength + 6, 14, shadow);
-
- gotoxy(startX + strLength / 2, 10);
- cputs(" ERROR ");
- gotoxy(startX + 3, 12);
- cputs(errorStr);
-
- // pause
- getch();
- // replace background
- puttext(startX, 10, startX + strLength + 6, 15, saved);
- return(OK);
- }
-
- /*************************************************************************
- * FUNCTION: DRAWDRVRINFO - saves the screen under the driver info box,
- * draws the driver info box at requested
- * location, and then replaces the saved info.
- *
- * Inputs: x,y - upper left corner of driver info box.
- * version - SBSIM version.
- * drv0 - first driver info.
- * drv1 - second driver info.
- * drv2 - third driver info.
- * drv3 - fourth driver info.
- * drv4 - fifth driver info.
- *
- * Output: status - error (not enough memory for save).
- *************************************************************************/
- int DrawDrvrInfo(int x, int y, int version, DVRINFO *drv0, DVRINFO *drv1,
- DVRINFO *drv2, DVRINFO *drv3, DVRINFO *drv4)
- {
- char *saved;
-
- saved = (char *)malloc(73 * 9);
- if(saved == NULL)
- return(ERROR);
-
- // save background
- gettext(x, y, x + 73, y + 9, saved);
-
-
- puttext(x, y, x + 44, y + 1, infoBoxTop);
- puttext(x + 45, y + 1, x + 46, y + 1, shadow);
- puttext(x, y + 2, x + 71, y + 8, infoBox);
- puttext(x + 2, y + 9, x + 37, y + 9, shadow);
- puttext(x + 37, y + 9, x + 73, y + 9, shadow);
- puttext(x + 72, y + 3, x + 73, y + 8, shadow);
-
- textcolor(WHITE);
- textbackground(BLUE);
-
- gotoxy(x + 17, y + 1);
- cprintf("%d.%02d", HIBYTE(version), LOBYTE(version));
- gotoxy(x + 40, y + 1);
- cprintf("%2X", SIMint);
-
- gotoxy(x + 14, y + 4);
- cprintf("%12s│%10s│%10s│%11s│%10s", statStr[drv0->status],
- statStr[drv1->status],
- statStr[drv2->status],
- statStr[drv3->status],
- statStr[drv4->status]);
- gotoxy(x + 14, y + 5);
- cprintf((drv0->status == LOADED)? "%12Fp│" : " │", drv0->entry);
- cprintf((drv1->status == LOADED)? "%10Fp│" : " │", drv1->entry);
- cprintf((drv2->status == LOADED)? "%10Fp│" : " │", drv2->entry);
- cprintf((drv3->status == LOADED)? "%11Fp│" : " │", drv3->entry);
- cprintf((drv4->status == LOADED)? "%10Fp" : " ", drv4->entry);
-
- gotoxy(x + 14, y + 6);
- cprintf(((drv0->status == LOADED) && (drv0->bufLoc != 0))?
- "%12Fp│" : " │", drv0->bufLoc);
- cprintf(((drv1->status == LOADED) && (drv1->bufLoc != 0))?
- "%10Fp│" : " │", drv1->bufLoc);
- cprintf(((drv2->status == LOADED) && (drv2->bufLoc != 0))?
- "%10Fp│" : " │", drv2->bufLoc);
- cprintf(((drv3->status == LOADED) && (drv3->bufLoc != 0))?
- "%11Fp│" : " │", drv3->bufLoc);
- cprintf(((drv4->status == LOADED) && (drv4->bufLoc != 0))?
- "%10Fp" : " ", drv4->bufLoc);
-
- gotoxy(x + 14, y + 7);
- cprintf(((drv0->status == LOADED) && (drv0->bufSize != 0))?
- "%11uk│" : " │", drv0->bufSize);
- cprintf(((drv1->status == LOADED) && (drv1->bufSize != 0))?
- "%9uk│" : " │" , drv1->bufSize);
- cprintf(((drv2->status == LOADED) && (drv2->bufSize != 0))?
- "%9uk│" : " │" , drv2->bufSize);
- cprintf(((drv3->status == LOADED) && (drv3->bufSize != 0))?
- "%10uk│" : " │" , drv3->bufSize);
- cprintf(((drv4->status == LOADED) && (drv4->bufSize != 0))?
- "%9uk" : " " , drv4->bufSize);
-
- // pause
- getch();
- // replace background
- puttext(x, y, x + 73, y + 9, saved);
- return(OK);
- }
-
-